<template>
    <div class="vconsole-container"></div>
</template>

<script>
// 建议测试环境mian.js全局引入
// import VConsole from 'vconsole';
// const vConsole = new VConsole();
import { defineComponent, onMounted, onUnmounted } from 'vue'
export default defineComponent({
  setup () {
    let vConsole = null
    const initVConsole = () => {
      import('vconsole').then((VConsole) => {
        vConsole = new VConsole.default()
        console.log('测试错误输出')
      })
    }
    onMounted(() => {
      initVConsole()
    })
    onUnmounted(() => {
      vConsole && vConsole.destroy()
    })
  }
})
</script>
